#ifndef STYLEEDITORIMPL_H
#define STYLEEDITORIMPL_H
//
#include "ui_styleeditor.h"

#include "stylemodel.h"
#include "configurationmodel.h"
//
class StyleEditorImpl : public QDialog, public Ui::StyleEditor
{
Q_OBJECT
public:
	StyleEditorImpl( QWidget * parent = 0, Qt::WFlags f = 0 );
	
	void setManagers(ConfigurationManager *confManager, StyleManager *styleManager);	
	void updateStyleList();

private slots:
	void on_tbMoveUp_clicked();
	void on_tbMoveDown_clicked();
	void on_tbRemoveStyle_clicked();
	void on_tbAddStyle_clicked();
	void on_lwStyle_currentItemChanged(QListWidgetItem* current, QListWidgetItem* previous);
	void on_tbFontColor_clicked();
	void onFinished(int result);
	
private:
	QColor currentColor;
	StyleManager *m_styleManager;
	ConfigurationManager *m_confManager;
	
	int m_defaultFont;
	int m_defaultFontSize;
	
	void drawColor(QColor color);
	void fillComboSize();
	void initCombos();
	
	void updateModelFromUI(int index);
	void updateUIFromModel(int index);
};
#endif





